package com.viphuli.app.tool.handler;

import java.util.List;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

import com.viphuli.app.tool.adapter.ArrangeMemberAdapter;
import com.viphuli.app.tool.bean.page.CircleInfoPage;
import com.viphuli.app.tool.bean.part.AccountUser;
import com.viphuli.app.tool.fragment.CircleMemberDialogFragment;

public class ArrangeCircleMemberResponseHandler extends MyBaseHttpResponseHandler<CircleMemberDialogFragment, CircleInfoPage> implements
		OnItemClickListener {

	@Override
	public void deal() {

		List<AccountUser> memberList = page.getCircleInfo().getMembers();
		caller.getList().clear();
		caller.getList().addAll(memberList);

		ArrangeMemberAdapter adapter = new ArrangeMemberAdapter(caller.getList());
		caller.setAdapter(adapter);

		caller.getListview().setAdapter(adapter);
		caller.getListview().setOnItemClickListener(this);

	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

		//选择操作
		ArrangeMemberAdapter adapter = (ArrangeMemberAdapter) caller.getAdapter();
		adapter.check(position);

	}

}
